import pandas as pd
import numpy as np
import random
#第一步读取信息
pro = pd.read_excel('D:/ITaudit/pandas_excel/pro1.xlsx')
pro = pro.set_index(['产品名称'])
# 第二步筛选出*产品
pro1 = pro.loc['*产品'].copy()
sum1 = pro1.sum()
sums = sum1.values#取出series的所有值
pro1.loc['合计'] = sums#增加一行数据
print(pro1)
# pro2 = pro1.append(sum1, ignore_index=True)
# print(pro2)

# print(pro2)
# pro2 = pd.read_excel('D:/ITaudit/pandas_excel/pro1.xlsx',sheet_name=1)
# pro2 = pro2.set_index(['产品名称'])
# pro3 =pro2.loc['*产品']
# print(pro3)